<?php

include FCPATH . 'application/controllers/frontend.php';

class Jobs extends Frontend {

    public function __construct() {
	parent::__construct();
    }
 
    public function index(){
        $this->load_javascripts('frontend_jobs');
        $this->rend('frontend/jobs_index_view');
    }
    
    public function records(){
        $this->load->model('jobs_model', 'model');
        $page = intval($this->input->get('page'));
        $page_size = intval($this->input->get('pageSize'));
        $offset = ($page - 1) * $page_size;

        $this->json_back('XT001', '', array(
            'total' => $this->model->total(),
            'records' => $this->model->frontend_records($page_size, $offset)
        ));
    }
}

